Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go buildpack #3150

Merged
merged 47 commits into from
Aug 29, 2024
Merged

go buildpack #3150

merged 47 commits into from
Aug 29, 2024

Conversation

bonzofenix
Copy link
Contributor

  • Uses envconfig package to get port from environment variable
  • Refactor: give priority to env variables over yaml configs
  • WIP
  • Change build-cf tasks to cf-build to avoid conflicts
  • Update git ignore to try issue with telescope
  • WIP
  • Update go-chi/chi to v5.1.0 and add mitchellh/mapstructure v1.1.2 in autoscaler module
  • Refactor error variable names and update associated tests in metricsforwarder config
  • Add nosec comment to bypass G101 security warning in metricsforwarder config test
  • Remove package-lock.json and package.json from autoscaler module
  • ** Change deployment directory and use mta-deploy in deploy-apps.sh**
  • merge
  • Remove envconfig dependency
  • 🤖🦾🛠️ go mod tidy & make package-specs
  • Refactor config loading and add VCAP_SERVICES support in metricsforwarder
  • Add early return for existing DB config in metricsforwarder config read function
  • ** Refactor metricsforwarder config loading with JSON support**
  • 🤖🦾🛠️ go mod tidy & make package-specs
  • ** Refactor deployment scripts and Makefiles for autoscaler**
  • Refactor VCAPConfiguration and error handling in cf.go
  • Refactor metricsforwarder config loading and VCAP services handling
  • Add configutil directory to metricsforwarder package spec
  • t push Add error handling for VCAP configuration reading in metricsforwarder
  • Remove unnecessary blank line in config.go and annotate potential security issue in config_test.go with #nosec G101
  • Add nosec comment to suppress G101 warning in metricsforwarder config test
  • Add nosec comment to suppress false positive in config_test security scan
  • Remove unused error variable and update error handling in VCAP config
  • Update VCAPConfiguration to return JSON marshaled credential content
  • fix failing tests
  • Refactor VCAPConfiguration methods to use service tags instead of names
  • ** Update go-cfenv package and dependencies**
  • Remove cf-build target from go_app Makefile
  • Fix lints
  • Fix issue with metricsforwarder config test
  • Update app autoscaler release tools image source to bonzofenix repository
  • Update base image in autoscaler-tools Dockerfile to ubuntu:mantic
  • ** Update credhub-cli to 2.9.35 and add plugin_version to ruby in devbox.lock**
  • Fix tests run in github ci
  • Remove netcat from autoscaler-tools Dockerfile dependencies
  • Try noble image for ci
  • Update app autoscaler release tools image source to ghcr.io

bonzofenix and others added 30 commits June 27, 2024 16:28
 - Update deploy function to change into the autoscaler directory instead of metricsforwarder
 - Replace `make cf-push` with `make mta-deploy` for deploying autoscaler apps
 - Mark `mta-deploy` as .PHONY in Makefile, replacing `cf-push`
…rder

 • Extract YAML file decoding into DecodeYamlFile function for cleaner LoadConfig.
 • Implement readDbFromVCAP and readConfigFromVCAP to load database and other configurations from VCAP_SERVICES.
 • Update loadVCAPEnvs to use the new VCAP reading functions.
 • Modify tests to handle new environment variable-based configuration loading and add checks for VCAP_SERVICES parsing.
 • Fix error handling in readDbFromVCAP to return an error when multiple DB services are tagged as relational.
 - Add JSON decoding support for VCAP_SERVICES
 - Replace DecodeYamlFile with decodeYamlFile for consistency
 - Remove unused readConfigFromVCAP function
 - Update config_test.go to test VCAP_SERVICES JSON loading
 - Replace `mta-deploy` target with `deploy-apps` in Makefile
 - Add `bbl print-env` setup in `deploy-apps.sh`
 - Remove `deploy-multiapps-controller.sh` script's redundant newline
 - Remove metricsforwarder route port configuration in `use-cf-services.yml`
 - Remove instance group `metricsforwarder` from `use-cf-services.yml`
 - Update `autoscaler/Makefile` to use `build-extension-file.sh` for extension file generation
 - Add `build-extension-file.sh` script for dynamic extension file creation
 - Introduce `configutil` package with `cf.go` for VCAP service configuration parsing
 - Add `configutil_suite_test.go` and `configutil_test.go` for the new `configutil` package
 - Remove `example.mtaext` as extension file generation is now dynamic
 - Update `generate-fakes.go` to include fake VCAP configuration reader
 - Remove `helpers/cf.go` as its functionality is replaced by `configutil`
 - Update `metricsforwarder/Makefile` to remove obsolete targets and variables
 - Refactor `metricsforwarder` main and config to use `configutil` for VCAP services
 - Add `default_config.json` for `metricsforwarder` default configuration
 - Update `mta.yaml` to define `metricsforwarder` module with new resources and parameters
 • Consolidate error variable declarations into a var block
 • Add new error type for missing credentials
 • Streamline NewVCAPConfigurationReader function
 • Refactor TLS and DB materialization methods for clarity
 • Introduce helper functions for service retrieval and TLS cert file creation
 • Improve error messages with more context
 • Implement new methods in VCAPConfiguration for port retrieval, CF environment check, and service credential access.
 • Remove direct cfenv and JSON handling from metricsforwarder/config, using VCAPConfigurationReader interface instead.
 • Consolidate error variables in metricsforwarder/config.
 • Update tests to mock new VCAPConfigurationReader methods and adjust for refactored config loading logic.
…urity issue in config_test.go with #nosec G101
bonzofenix and others added 17 commits August 27, 2024 18:25
 • Remove ErrReadEnvironment variable from cf.go
 • Change error handling to print a message instead of returning an error when failing to read VCAP_APPLICATION
 • Add tests for IsRunningOnCF when VCAP_APPLICATION is not set
 • Remove unused unsetEnvVars function and related test scenarios in cmd metricsforwarder_test.go
 - Change import path from cloudfoundry-community to cloud-gov for go-cfenv
 - Upgrade go-cfenv to v1.19.1
 - Update mapstructure package to v1.5.0
@bonzofenix bonzofenix added the allow-acceptance-tests This label needs to be added to enable the acceptance tests to run. label Aug 28, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5 Security Hotspots

See analysis details on SonarCloud

@bonzofenix bonzofenix merged commit 47d35bd into main Aug 29, 2024
89 of 92 checks passed
@bonzofenix bonzofenix deleted the go-buildpack branch August 29, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
allow-acceptance-tests This label needs to be added to enable the acceptance tests to run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant